﻿/*----------------------------------------
//Copyright(c) 2013
//版权所有。
//
*/


$(function () {
    //初始化数据表格PoliceManTypegrid
    $('#evidenceTypeGrid').datagrid({
        //url: '/BaseData/LoadEvidenceTypeList',
        title:'物品类型列表',
        fitColumns: true,
        idField: 'Id',
        pagination: true,
        pageNumber: 1,
        pageSize: 20,
        nowrap: false, 
        singleSelect: true,
        checkOnSelect: true,
        selectOnCheck: true,
        columns: [[
					{ field: 'Name', title: '名称', width: 150, align: 'center' },
					{ field: 'Number', title: '编码', width: 150, align: 'center' },
					{ field: 'Description', title: '描述', width: 300, align: 'center' },
                    { field: 'Id', title: 'Id', width: 130, align: 'center', hidden: true }
        ]]
    }); 

    loadEvidenceTypeList();

});


function loadEvidenceTypeList() {
    $.ajax({
        url: "/BaseData/LoadEvidenceTypeList",
        type: "POST",
        dataType: "json",
        success: function (req) {
            if (req.IsSuccess) {//成功填充数据
                try {
                    var objs = JSON.parse(req.Data);
                }
                catch (ex) {
                    alert(ex);
                }
                $('#evidenceTypeGrid').datagrid("loadData", objs);
            }
            else {
                alert("获取数据失败");
            }
        }
    });
}
